//
//  FPRepayResultController.m
//  FinanceProject
//
//  Created by 陈显摆 on 2025/3/17.
//

#import "FPRepayResultController.h"
#import "FPBankCardModel.h"

@interface FPRepayResultController ()

@property (weak, nonatomic) IBOutlet UIImageView *statusImgView;
@property (weak, nonatomic) IBOutlet UILabel *statusLab;
@property (weak, nonatomic) IBOutlet UILabel *tipLab;

@end

@implementation FPRepayResultController

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (void)initUI {
    
    [self setTitle:@"还款" style:(XYCustomNavigationStyleWhite) hiddenBackBtn:NO];
    self.view.backgroundColor = UIColor.whiteColor;
    
    self.statusLab.textColor = [UIColor hexColor:@"#3A3A3A"];
    self.tipLab.textColor = [UIColor hexColor:@"#6A6A6A"];
    self.tipLab.hidden = YES;
    
    [self repayLoading];
    
    [self getStatus];
}

- (void)getStatus {
    
    [FPBankCardModel getOrderStatusWithID:@"abc" success:^(NSInteger code, NSString * _Nonnull message) {
        
        if (code == 200) {
            
            
        }
        
    } failure:^(NSError * _Nonnull error) {
        [self showError:error];
    }];
}

- (void)repayLoading {
    
    self.statusImgView.image = IMG(@"icon_repay_result_loading");
    self.statusLab.text = @"还款中";
    self.tipLab.hidden = YES;
}

- (void)repaySuccess {
    
    self.statusImgView.image = IMG(@"icon_repay_result_success");
    self.statusLab.text = @"还款成功";
    self.tipLab.hidden = YES;
}

- (void)repayFailure {
    
    self.statusImgView.image = IMG(@"icon_repay_result_success");
    self.statusLab.text = @"还款失败";
    self.tipLab.hidden = NO;
    
    self.tipLab.text = @"原因：银行卡余额不足";
}



@end
